<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=utf-8">
<Meta http-equiv="Content-language" Content="zh-CN">
<title>桂林电子科技大学毕业论文</title>
<link rel="stylesheet" type="text/css" href="print.css" />
<style type="text/css" media="screen">
#header {
	display: none;
}

div.article {
	border: 1px solid #ccc;
	line-height: 20pt;
	padding: 2.5cm;
}
code,pre {
	color: #007000;
	}
</style>
<style type="text/css" media="print">
#header {
	position: fixed;
	top: 0;
	text-align: center;
	text-size: small;
	padding-bottom: 3px;
}

body{
line-height: 20pt;
}
.en-abstract,.body h2,.catalog {
	page-break-before: always;
}
</style>
<style>
@page {
	size: 21cm, 29.7cm;
}
/**  @media screen{
            	#header{display:none;}
            }
            @media print{
            	#header{position:fixed;top:0;text-align:center;text-size:small;padding-bottom:3px;width:16em;margin-left:auto;margin-right:auto;}
            }**/
.zh-abstract h2,.en-abstract h2，.catalog h2 {
	font-size: 16pt;
	text-align: center;
	font-family: "黑体";
}

.zh-abstract h2 {
	font-family: "黑体";
}

.zh-abstract p,.zh-keyword {
	font-size: 12pt;
	font-family: "宋体";
}

.zh-keyword-label {
	font-size: 12pt;
	font-family: "黑体";
}

.en-abstract h2 {
	font-family: "Times New Roman";
	font-weight: bold;
	text-align: center;
}

.en-abstract h2,.en-keyword {
	font-size: 12pt;
	font-family: "Times New Roman";
}

.en-keyword-label {
	font-weight: bold;
}

/**** catalog start  **/
h2.catalog_label {
	text-align: center;
}

.catalog li {
	list-style: none;
	overflow: hidden;
	white-space: nowrap;
	line-height: 1.5em;
	background-image: url(drawables/dots.png);
	background-position: 0 60%;
	background-repeat: repeat-x;
	marin-right:1em;
}
.catalog li .page_number{margin-left:1em;}

.catalog li.catalog_branch {
	background: none;
}

.catalog span {
	background: white;
}

.section_name {
	font-size: 14pt;
	font-family: "黑体";
}

.sub_section_name {
	font-size: 12pt;
	font-family: "黑体";
}

.sub_sub_section_name {
	font-size: 12pt;
	font-family: "楷体";
}

.page_number {
	font-size: 12pt;
	font-family: "宋体";
	text-align: right;
	float: right;
}

span.section_name,span.sub_section_name,span.sub_sub_section_name {
	width: 16cm;
	overflow: hidden;
}
/** span.section_name:after{content:"…………………………………";}
              span.sub_section_name:after{content:"…………………………………";}
              span.sub_sub_section_name:after{content:"…………………………………";}**/

/*** body **/
body {
	width: 21cm;
	margin-left: auto;
	margin-right: auto;
	font-size:12pt;
}

h2+div,h3+div,h4+div,h5+div,h6+div {
	text-indent: 2em;
}

p {
	text-indent: 2em;
}

code,pre {
	font-family: monospace;
	line-height: 1em;
}

pre {
	border: 1px solid #ccc;
	background-color: #fafafa;
	padding: 10px;
	margin: 0 0 1em 1em;
	overflow: auto;
	line-height: inherit;
	font-family: monospace;
}

/*** references **/
.cite_list li {
	list-style: none;
}
li.long_cite{display:table-row;}
span.long_cite,li.long_cite cite{display:table-cell;}
pre {
	text-align: left;
}
div.img_wrapper{text-align:center;}
p.pic_desc{	font-size: 10.5pt;
	font-family: "黑体";font-weight: bold;}
cite.zh{font-size: 10.5pt;
	font-family: "宋体";}
	cite.en{	font-size: 10.5pt;
	font-family: "Times New Roman";font-style:normal;}
</style>
</head>

<body>
	<div class="article">
		<div class="zh-abstract">
			<h2>摘 &nbsp;&nbsp;&nbsp;&nbsp;要</h2>

			<p>
				本文分析了wlan（无线局域网）的特点及应用领域，并对最常见的无线局域网组网通信技术：Wi-Fi，蓝牙（Bluetooth)，进行了分析。
				分析下当前最流行的移动操作系统Android。着重描述了Android操作系统的一些特性及应用。分析了如何在Android平台基于MVC框架进行应用开发，
				分析Android平台开发中，Model层的开发技术-包括使用各种数据存储技术，
				View层开发应用-分析了如何使用Android进行资源管理，详细分析了Android中UI系统框架，
				分析了Android控制层的开发及应用，详细分析了Activity,Intent及Intent过滤器的使用。
				给出了基于Android移动操作系统平台使用Wi-Fi进行无线局域网通信的应用实例-点菜系统。
				详细说明的无线点菜系统需要实现的功能，及对在应用设计上遇到的一些问题，对问题的分析思考与解决方案，
				本文就如何开发可读性强的软件，对如何改善代码可读性进行的详细的分析，使用重构来改善代码的既有设计进行了分析讨论，并对Android平台如何对代码进行性能优化
				进行了总结。
			</p>
			<p class="zh-keyword">
				<span class="zh-keyword-label">关键词：</span>
				android;wifi;wlan;MVC;点菜系统;平板点菜;
			</p>
		</div>
		<!-- end of zh-abstract -->

		<div class="en-abstract">
			<h2>Abstract</h2>

			<p>This paper analyzes the characteristics and applications of the wlan (wireless LAN), 
			and the most common wireless LAN networking communication technologies: Wi-Fi, Bluetooth (Bluetooth), were analyzed.
Analysis under the current most popular mobile operating system Android. 
Focus on description of some of the features of the Android operating system and applications. 
Analysis of how the development of applications on the Android platform based on the MVC framework,
Analysis of the Android platform, the development of the Model layer - including the use of a variety of data storage technology,
View layer development and application - analysis of how to use Android for resource management, a detailed analysis of the system in Android UI framework.
Analysis of the development and application of the control layer in Android, a detailed analysis of the use of Activity, Intent to and Intent Filters.
Given application instance - ordering system based on the Android mobile operating system platform, using Wi-Fi wireless LAN communication.
Details need to implement the functionality of wireless ordering system, and some of the problems encountered in the application design, analysis of the problem of thinking and solutions.
In this paper, how to develop readable software, detailed analysis of how to improve code readability, use refactoring to improve the existing design of the code are analyzed and discussed, and Android platform code performance optimization
Are summarized.</p>
			<p class="en-keyword">
				<span class="en-keyword-label">Keyword：</span> android;wifi;wlan;tablet order dishes;order dishes system;
			</p>
		</div>
		<!-- end of en-abstract -->
		<div class="catalog">
			<h2 class="catalog_label">目录</h2>
			<ul>
				<li><span class="section_name">引言</span><span class="page_number">1</span></li>
				<li><span class="section_name">1&nbsp;&nbsp;基础理论之：无线局域网及网络通信</span><span class="page_number">2</span></li>
				<li class="catalog_branch">
					<ol>
						<li>
						<span class="sub_section_name">1.1&nbsp;无线局域网</span><span class="page_number">2</span></li>
						<li class="catalog_branch">
							<ol>
								<li><span class="sub_sub_section_name">1.1.1&nbsp;技术特点</span><span class="page_number">2</span></li>
								<li><span class="sub_sub_section_name">1.1.2&nbsp;WLAN的优点及不足之处</span><span class="page_number">2</span></li>
								<li><span class="sub_sub_section_name">1.1.3&nbsp;WLAN常见应用场景</span><span class="page_number">2</span></li>
								<li><span class="sub_sub_section_name">1.1.4&nbsp;常见的简单的组建无线局域网的方案</span><span class="page_number">3</span></li>
							</ol>
						</li>
						<li>
						<span class="sub_section_name">1.2&nbsp;Wi-Fi</span><span class="page_number">3</span></li>
						<li class="catalog_branch">
							<ol>
								<li><span class="sub_sub_section_name">1.2.1&nbsp;工作原理</span><span class="page_number">3</span></li>
								<li><span class="sub_sub_section_name">1.2.2&nbsp;优势和挑战</span><span class="page_number">4</span></li>
							</ol>
						</li>
						<li>
						<span class="sub_section_name">1.3&nbsp;蓝牙及Wi-Fi&nbsp;Direct</span><span class="page_number">4</span></li>
						<li class="catalog_branch">
							<ol>
								<li><span class="sub_sub_section_name">1.3.1&nbsp;蓝牙的历史</span><span class="page_number">4</span></li>
								<li><span class="sub_sub_section_name">1.3.2&nbsp;蓝牙应用</span><span class="page_number">4</span></li>
								<li><span class="sub_sub_section_name">1.3.3&nbsp;Wi-Fi&nbsp;Direct</span><span class="page_number">4</span></li>
							</ol>
						</li>
						
					</ol>
				</li>
				<li><span class="section_name">2&nbsp;&nbsp;基础理论之：Android</span><span class="page_number">5</span></li>
				<li class="catalog_branch">
					<ol>
						<li>
						<span class="sub_section_name">2.1&nbsp;Android概述</span><span class="page_number">5</span></li>
						<li class="catalog_branch">
							<ol>
								<li><span class="sub_sub_section_name">2.1.1&nbsp;特点(Features)</span><span class="page_number">5</span></li>
								<li><span class="sub_sub_section_name">2.1.2&nbsp;android 体系结构(Android
							Architecture)</span><span class="page_number">5</span></li>
								<li><span class="sub_sub_section_name">2.1.3&nbsp;应用及应用框架</span><span class="page_number">6</span></li>
								<li><span class="sub_sub_section_name">2.1.4&nbsp;Android运行时(Android Runtime）</span><span class="page_number">6</span></li>
								<li><span class="sub_sub_section_name">2.1.5&nbsp;Linux内核（Linux Kernerl）</span><span class="page_number">6</span></li>
							</ol>
						</li>
						<li>
						<span class="sub_section_name">2.2&nbsp;Android 基本构架（application fundamentals)</span><span class="page_number">6</span></li>
						<li class="catalog_branch">
							<ol>
								<li><span class="sub_sub_section_name">2.2.1&nbsp;基本特点</span><span class="page_number">6</span></li>
								<li><span class="sub_sub_section_name">2.2.2&nbsp;应用程序组件</span><span class="page_number">6</span></li>
							</ol>
						</li>
						
					</ol>
				</li>
				<li><span class="section_name">3&nbsp;&nbsp;开发环境搭建</span><span class="page_number">7</span></li>
				<li class="catalog_branch">
					<ol>
						<li><span class="sub_section_name">3.1&nbsp;安装Anroid SDK</span><span class="page_number">7</span></li>
						<li><span class="sub_section_name">3.2&nbsp;安装Eclipse及ADT</span><span class="page_number">8</span></li>
						<li><span class="sub_section_name">3.3&nbsp;使用版本控制工具：SVN</span><span class="page_number">9</span></li>
						<li><span class="sub_section_name">3.4&nbsp;建立无线热点</span><span class="page_number">9</span></li>
					</ol>
				</li>
				<li><span class="section_name">4&nbsp;&nbsp;系统设计</span><span class="page_number">11</span></li>
				<li class="catalog_branch">
					<ol>
						<li><span class="sub_section_name">4.1&nbsp;设计原则</span><span class="page_number">11</span></li>
						<li><span class="sub_section_name">4.2&nbsp;概要设计</span><span class="page_number">11</span></li>
						<li><span class="sub_section_name">4.3&nbsp;功能实现</span><span class="page_number">13</span></li>
					</ol>
				</li>

			  <li><span class="section_name">5&nbsp;&nbsp;MVC风格的应用框架:M-数据模型层</span><span class="page_number">14</span></li>
				<li class="catalog_branch">
					<ol>
						<li><span class="sub_section_name">5.1&nbsp;SharedPreferences(共享的首选项)</span><span class="page_number">14</span></li>
							<ol>
								<li><span class="sub_sub_section_name">5.1.1&nbsp;使用SharedPreferences存储用户设置偏好</span><span class="page_number">14</span></li>
							</ol>						
						
						<li><span class="sub_section_name">5.2&nbsp;使用外部存储空间</span><span class="page_number">15</span></li>
						<li class="catalog_branch">
							<ol>
								<li><span class="sub_sub_section_name">5.2.1&nbsp;检测外部媒介的可用性</span><span class="page_number">16</span></li>
								<li><span class="sub_sub_section_name">5.2.2&nbsp;访问在外部存储中的文件</span><span class="page_number">16</span></li>
								<li><span class="sub_sub_section_name">5.2.3&nbsp;保存需要共享的文件</span><span class="page_number">16</span></li>
								<li><span class="sub_sub_section_name">5.2.4&nbsp;外部存储空间及应用更新功能实现</span><span class="page_number">17</span></li>
							</ol>
						</li>
						
						<li><span class="sub_section_name">5.3&nbsp;使用数据库</span><span class="page_number">17</span></li>
						<li class="catalog_branch">
							<ol>
								<li><span class="sub_sub_section_name">5.3.1&nbsp;基本用法</span><span class="page_number">17</span></li>
								<li><span class="sub_sub_section_name">5.3.2&nbsp;使用SQLite数据库保存菜单数据，及浏览菜品实现</span><span class="page_number">18</span></li>
								
							</ol>
						</li>
					</ol>
				</li>
				<li><span class="section_name">6&nbsp;&nbsp;MVC风格的应用框架:V-视图界面打造现代自然的用户界面</span><span class="page_number">20</span></li>
				   	    <li class="catalog_branch">
							<ol>
								<li><span class="sub_section_name">6.1&nbsp;Android应用程序资源</span><span class="page_number">20</span></li>
								<li class="catalog_branch">
									<ol>
										<li><span class="sub_sub_section_name">6.1.1&nbsp;资源类型</span><span class="page_number">20</span></li>
										<li><span class="sub_sub_section_name">6.1.2&nbsp;访问资源(Accessing Resources)</span><span class="page_number">20</span></li>
									</ol>
								</li>
							
								<li><span class="sub_section_name">6.2&nbsp;Android&nbsp;UI系统</span><span class="page_number">21</span></li>
								<li class="catalog_branch">
									<ol>
									<li><span class="sub_sub_section_name">6.2.1&nbsp;View的层级结构</span><span class="page_number">21</span></li>
									<li><span class="sub_sub_section_name">6.2.2&nbsp;Android绘制View的方式</span><span class="page_number">22</span></li>
									</ol>
								</li>
							
							<li><span class="sub_section_name">6.3&nbsp;Android UI部件及事件</span><span class="page_number">22</span></li>
							<li class="catalog_branch">
								<ol>
									<li><span class="sub_sub_section_name">6.3.1&nbsp;布局</span><span class="page_number">22</span></li>
									<li><span class="sub_sub_section_name">6.3.2&nbsp;Widgets</span><span class="page_number">23</span></li>
									<li><span class="sub_sub_section_name">6.3.3&nbsp;事件</span><span class="page_number">23</span></li>
									<li><span class="sub_sub_section_name">6.3.4&nbsp;菜单</span><span class="page_number">24</span></li>
									<li><span class="sub_sub_section_name">6.3.5&nbsp;适配器（Adapter)</span><span class="page_number">24</span></li>
								</ol>
							</li>
							<li><span class="sub_section_name">6.4&nbsp;使用GridView及自定义Adapter实现菜品格子显示</span><span class="page_number">26</span></li>
						  </ol>
						</li>
				
				
				<li><span class="section_name">7&nbsp;&nbsp;MVC风格的应用框架:C-应用控制器</span><span class="page_number">27</span></li>
				 		<li class="catalog_branch">
							<ol>
								<li><span class="sub_section_name">7.1&nbsp;Activity:控制器中心</span><span class="page_number">27</span></li>
								<li class="catalog_branch">
									<ol>
										<li><span class="sub_sub_section_name">7.1.1&nbsp;创建活动Activity</span><span class="page_number">27</span></li>
										<li><span class="sub_sub_section_name">7.1.2&nbsp;启动Activity</span><span class="page_number">27</span></li>
										<li><span class="sub_sub_section_name">7.1.3&nbsp;Android多任务机制</span>
										<span class="page_number">28</span></li>
										<li><span class="sub_sub_section_name">7.1.4&nbsp;管理活动的生命周期</span><span class="page_number">30</span></li>
									</ol>
								</li>
								<li><span class="sub_section_name">7.2&nbsp;Intent及Intent&nbsp;Filter</span><span class="page_number">32</span></li>
									<li class="catalog_branch">
									<ol>
										<li><span class="sub_sub_section_name">7.2.1&nbsp;Intent对象</span><span class="page_number">32</span></li>
										<li><span class="sub_sub_section_name">7.2.2&nbsp;Intent解析及过滤</span>
										<span class="page_number">34</span></li>
									</ol>
								</li>
							</ol>
						</li>
				<li><span class="section_name">8&nbsp;&nbsp;设计中问题及解决方案</span><span class="page_number">36</span></li>
						<li class="catalog_branch">
							<ol>
							<li><span class="sub_section_name">8.1&nbsp;基础数据的缓存与数据同步</span><span class="page_number">36</span></li>
							<li><span class="sub_section_name">8.2&nbsp;动态即时数据的缓存与同步</span><span class="page_number">36</span></li>
							<li><span class="sub_section_name">8.3&nbsp;多线程与Socket通信</span><span class="page_number">37</span></li>
							<li><span class="sub_section_name">8.4&nbsp;响应性设计与AsyncTask</span><span class="page_number">37</span></li>
							</ol>
						</li>
						<!--  end of catalog section 8 -->
				<li><span class="section_name">9&nbsp;&nbsp;Android开发中的重构实践</span><span class="page_number">40</span></li>
						<li class="catalog_branch">
							<ol>
							<li><span class="sub_section_name">9.1&nbsp;重构出一个实用的Toast工具类</span><span class="page_number">40</span></li>
							<li><span class="sub_section_name">9.2&nbsp;会说话的代码</span><span class="page_number">42</span></li>
								<li class="catalog_branch">
									<ol>
									<li><span class="sub_sub_section_name">9.2.1&nbsp;让代码说话</span><span class="page_number">42</span></li>
									<li><span class="sub_sub_section_name">9.2.2&nbsp;使用提取方法重构改善代码结构设计</span><span class="page_number">45</span></li>
									</ol>
								</li>
							</ol>
						</li>
						<!--  end of catalog section 9 -->
				<li><span class="section_name">10&nbsp;&nbsp;Android应用的性能优化</span><span class="page_number">47</span></li>
						<li class="catalog_branch">
							<ol>
							<li><span class="sub_section_name">10.1&nbsp;更有效的代码</span><span class="page_number">47</span></li>
							<li><span class="sub_section_name">10.2&nbsp;更有效的UI</span><span class="page_number">47</span></li>
							</ol>
						</li>	
						
						<!--  end of catalog section 10 -->

				<li><span class="section_name">11&nbsp;&nbsp;结论</span><span class="page_number">49</span></li>
				<li><span class="section_name">参考文献</span><span class="page_number">50</span></li>
				<li><span class="section_name">致谢</span><span class="page_number">51</span></li>
				<li><span class="section_name">附录</span><span class="page_number">52</span></li>
			</ul>
		</div>
		<!-- end of catalog -->
  </div>
  </body>
  </html>